package com.xoa.controller.task;


import com.xoa.service.task.TaskAnalysisService;
import com.xoa.service.task.TaskSubordinateService;
import com.xoa.util.ToJson;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;

/**
 *<p>
 *  任务分析
 *</p>
 *@author 王禹萌
 *@since  2019-12-21
 */
@Controller
@RequestMapping("/taskAnalysis")
public class TaskAnalysisController {

    @Autowired
    private TaskAnalysisService taskAnalysisService;

    /**
     * 查询我的任务 - 任务报表
     * @param request
     * @param
     * @return
     */
    @ResponseBody
    @RequestMapping("/queryAnalysisReport")
    public ToJson queryAnalysisReport(HttpServletRequest request){

        return taskAnalysisService.queryAnalysisReport(request);
    }

    /**
     * 点击柱状图-展示具体任务
     * @param request
     * @param type
     * @return
     */
    @ResponseBody
    @RequestMapping("/queryAnalysisTask")
    public ToJson queryAnalysisTask(HttpServletRequest request,int type,Integer pageSize, Integer page, Boolean useFlag){

        return taskAnalysisService.queryAnalysisTask(request,type,pageSize,page,useFlag);
    }

    /**
     * 查询饼状图
     * @param request
     * @return
     */
    @ResponseBody
    @RequestMapping("/queryPieTask")
    public ToJson queryPieTask(HttpServletRequest request){

        return taskAnalysisService.queryPieTask(request);
    }

    /**
     * 任务趋势
     * @param request
     * @param startDate
     * @return
     */
    @ResponseBody
    @RequestMapping("/queryTrendTask")
    public ToJson queryTrendTask(HttpServletRequest request,String startDate){

        return taskAnalysisService.queryTrendTask(request,startDate);
    }

}


















